package com.bjx.generator.enumerate;

public enum FieldTypeEnum {
    INT2("int2",(short)4),
    INT4("int4",(short)1),
    INT8("int8",(short)5),
    VARCHAR("varchar",(short)2),
    TEXT("text",(short)2),
    TIMESTAMP("timestamp",(short)3),
    BYTEA("bytea",(short)6);
    FieldTypeEnum(String dataType, Short fieldType) {
        this.dataType = dataType;
        this.fieldType = fieldType;
    }
    private String dataType;
    private Short fieldType;

    public static Short getFieldType(String dataType) {
        FieldTypeEnum fieldTypeEnum = FieldTypeEnum.valueOf(dataType.toUpperCase());
        return  fieldTypeEnum.fieldType;

    }

}
